Optical disc recorder and buffer management method thereof

ABSTRACT

A buffer management method is provided. A host issues a read command requesting access for a read data block and a write command requesting recording of a write data block. A write buffer is dedicated to store the write data block. A read buffer is dedicated to store the read data block. The method comprises entering the optical disc recorder into a write loop. During the write loop, the optical disc recorder triggering a write command handling procedure in response to the write command; triggering a read command handling procedure in response to the read command; and triggering a pre-recording procedure to prepare the write data block in the write buffer for recording. Wherein contents between the write buffer and read buffer are exchangeable during the write handling procedure, the read handling procedure or the pre-recording procedure.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of pending U.S. patent applicationSer. No. 12/024,130, filed Feb. 1, 2008 and entitled “Optical DiscRecorder and Buffer Management Method Thereof”, the entirety of which isincorporated by reference herein.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to optical disc drives, and in particular, to abuffer management method for an optical disc recorder.

2. Description of the Related Art

FIG. 1 shows a conventional structure of an optical disc recorder 100. Adrive control unit 106 controls a buffer 104 and performs physicalaccess of an optical disc 108. The drive control unit 106, in responseto a read commands #R issued by a host 102, accesses read data blocks#D_(R) from the optical disc 108 and stores the assessed read datablocks #D_(R) to the buffer 104. And then the drive control unit 106transfers the read data blocks #D_(R) to the host 102. In addition, thedrive control unit 106, in response to a write command #W issued by thehost 102, receives write data blocks #D_(W) transferred from host 102and stores it to the buffer 104. And then the drive control unit 106records the write data blocks #D_(W) to the optical disc 108.

The write data block #D_(W) instructed to be recorded into the opticaldisc 108 may not be instantly sent to the drive control unit 106 forrecording, but buffered in the buffer 104 until a specific condition(i.e. start recording condition) is met. For example, a plurality ofessential data blocks may be collected from the write data block #D_(W)to form an ECC block as a basic unit for physical recording. The ECCblock may be sent to the drive control unit 106 and be recorded onto theoptical disc 108 upon completed corresponding data blocks collection. Inanother exemplary embodiment, when a memory size of the stored writedata blocks #D_(W) is greater than a threshold, the write data blocks#D_(W) collected in an ECC unit are sent to the drive control unit 106and recorded onto the optical disc 108. Thereafter, a buffer area forstoring corresponding write data block #D_(W) or the read data block#D_(R) may be erased or released from the buffer 104. The buffer 104retains in a write loop as long as any write data block #D_(W) is stillpresent in the buffer 104 for recording. During the write loop, the readdata block #D_(R) and write data block #D_(W) in the buffer 104 may becontinuously accessed, modified, released or erased depending on thecommands issued from the host 102. Management of the read data block#D_(R) and write data block #D_(W) stored in the buffer 104 is animportant issue concerning increased performance and efficiency.

BRIEF SUMMARY OF THE INVENTION

An exemplary embodiment of a buffer management method for an opticaldisc recorder is provided, the optical disc recorder coupled to a hostissuing a read command requesting access for a read data block and awrite command requesting recording of a write data block. In which, awrite buffer is provided dedicated to store the write data block. A readbuffer is provided dedicated to store the read data block. The methodcomprises entering the optical disc recorder into a write loop. Duringthe write loop, the optical disc recorder triggering a write commandhandling procedure in response to the write command; triggering a readcommand handling procedure in response the read command; and triggeringa pre-recording procedure to prepare the write data block in the writebuffer for recording. Wherein contents between the write buffer and readbuffer are exchangeable during the write handling procedure, the readhandling procedure or the pre-recording procedure.

During the write loop, the write command handling procedure is triggeredupon receipt of a write command, the read command handling procedure istriggered upon receipt of a read command, and a pre-recording procedureis triggered to prepare the contents in the write buffer, such thatoptical disc writing efficiency is increased.

In the read command handling procedure, the method comprises: checkingwhether the requested read data block associated with the read commandis available in the write buffer; copying the read data block from thewrite buffer to the read buffer if the checked result is positive; andtransferring the read data block to the host as a response to the readcommand.

In the write command handling procedure, the method comprises: storingthe write data block to be recorded to the write buffer; andcopying/storing the write data block to the read buffer. Alternatively,the method further comprises: checking contents in the read buffer todetermine whether the write data block is an update of the contentstored in the read buffer before copying is executed, if the checkedresult is positive.

In the pre-recording procedure, an ECC block is established in the writebuffer as a basic unit for physical recording, the pre-recordingprocedure collects essential data blocks to increase integrity of an ECCblock, in which absent data blocks are obtained from the read buffer.Specifically, the pre-recording procedure further checks the contents inthe read buffer to determine whether a data block associated with theread command or write command contributes to the integrity of the ECCblock in the write buffer, and the read buffer copies the data block tothe write buffer to increase the integrity of the ECC block when thecontribution is confirmed.

Another embodiment provides a buffer management method implemented inthe described optical disc recorder, and a detailed description is givenin the following embodiments with reference to the accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention can be more fully understood by reading the subsequentdetailed description and examples with references made to theaccompanying drawings, wherein:

FIG. 1 shows a conventional structure of an optical disc recorder;

FIG. 2 a shows an embodiment of an optical disc recorder coupled to ahost;

FIG. 2 b is a flowchart of a buffer management method in a write loop;

FIG. 3 is a flowchart of a read command handling procedure in the writeloop;

FIG. 4 is a flowchart of a write command handling procedure in the writeloop; and

FIG. 5 is a flowchart of a pre-recording procedure in the write loop.

DETAILED DESCRIPTION OF THE INVENTION

The following description is of the best-contemplated mode of carryingout the invention. This description is made for the purpose ofillustrating the general principles of the invention and should not betaken in a limiting sense. The scope of the invention is best determinedby reference to the appended claims.

FIG. 2 a shows an embodiment of an optical disc recorder 200 coupled toa host 120. The host 120 may issue a read command #R to request opticaldisc recorder 200 accessing a read data block #D_(R) from the opticaldisc 205, or a write command #W to request optical disc recorderrecording a write data block #D_(W) to the optical disc 205. The opticaldisc recorder 200 includes at least a write buffer 210, a read buffer220 and a drive control unit 110. According to the invention, datablocks stored in the write buffer 210 and read buffer 220 are able to beexchanged between the write buffer 210 and read buffer 220. The writebuffer 210 is dedicated to store write data block #D_(W) for recordingoperation. The read buffer 220 is dedicated to store read data block#D_(R) for reading operation. In response to a write command #W and readcommand #R issued from the host 120, the drive control unit 110 coupledto the write buffer 210 and read buffer 220 is a processing unitperforming physical recording and reading data on and from the opticaldisc 205. In addition, the drive control unit 110 further controls thewrite buffer 210 and the read buffer 220 to manage the data blocksstored in the buffer 201 and 220 for improving performance andefficiency. In the embodiment, a buffer management method is provided tomanage the write buffer 210 and read buffer 220. The contents betweenthe write buffer 210 and read buffer 220 are exchangeable according torelationships of the read command #R, the write command #W and thecontents. In other words, the write buffer 210 and read buffer 220 aremutually interactive while each serves different functionality. Thedetailed embodiments are described below.

The data blocks received by drive control unit 110 may be directlystored into the write buffer 210. Alternatively, the received datablocks may be further be encoded before storing into the write buffer210. In addition, the data blocks received by drive control unit 110 maybe directly stored into the read buffer 210. Alternatively, the receiveddata blocks may be further be decoded before storing into the readbuffer 210. In other word, an encoding and modulation mechanism isrequired before the data blocks may need to be further encoded and arebefore recordingrecorded onto the optical disc, and likewise, a decodingand demodulation mechanism is required before transfer back the datablocks are transferred to the host. This is well known for the personskilled in the art. The detailed descriptions are omitted for the sakeof brevity.

FIG. 2 b is a flowchart of a buffer management method in a write loop.The optical disc recorder enters a write loop as long as when any writedata block #D_(W) is stored in the write buffer 210 for recording. Thewrite loop is initialized in step 201, and thereafter, in step 202, thedrive control unit 110 checks the write buffer 210 to determine whetherany write data block #D_(W) is buffered for recording. If not, step 299exits the write loop. Otherwise, the process goes to step 204, and thedrive control unit 110 checks whether any command issued from host 120has been received. If a read command #R is received, a read commandhandling procedure is triggered in step 206 to provide the requestedread data block #D_(R), and conveniently, the write buffer 210 and/orread buffer 220 are rearranged for better performance. Likewise, if awrite command #W is received, the write data block #D_(W) is transferredfrom the host 120 and stored into the write buffer 210 by a writecommand handling procedure in step 208, and the contents in the writebuffer 210 and read buffer 220 are further regulated to increase theefficiency. If no command received, then goes to step 211, apre-recording procedure is further executed, whereby at least an ECCblock is prepared as basic unit for physical recording. After step 211,a recording procedure is performed in step 212. If a recording startcondition is met, the drive control unit 110 records the prepared ECCblock onto the optical disc 205. Detailed embodiments of the proceduresare further described below.

In alternative embodiment, when the recording start condition is met,the pre-recording procedure is initialized. And then, the recordingprocedure is performed to record the data blocks into the optical disc205. Otherwise, the process goes tp step 202.

FIG. 3 is a flowchart of a read command handling procedure in the writeloop. In step 302, the read command handling procedure is initialized.In step 304, the drive control unit 110 checks whether the requestedread data block #D_(R) associated with the read command #R is availablein the write buffer 210 but not in the read buffer 220. Normally theavailability is referred to as a cache ‘hit’, whereas the unavailabilityis a cache ‘miss’. If the read data block #D_(R) is ‘hit’ in the writebuffer 210, step 306 is executed, whereby the drive control unit 110copies the read data block #D_(R) from the write buffer 210 to the readbuffer 220. Thereafter, in step 308, the read buffer 220 transfers theread data block #D_(R) to the host 120 as a response to the read command#R. If the read data block #D_(R) is ‘missed’ in both write buffer 210and read buffer 220, step 312 may be executed to physical access theoptical disc 205 for retrieving the read data block #D_(R) from theoptical disc 205. After step 312, step 308 is executed. In step 314, thedrive control unit 110 searches the write buffer 210 to determinewhether an ECC block related to the retrieved read data block #D_(R) isexisted. Thereafter, in step 316, it is determined whether the foundretrieved data blocks are contributive to the integrity of the ECCblock. If so, step 318 is processed, wherein the drive control unit 110transfers the found retrieved data blocks to the write buffer 210 toincrease the integrity of the ECC block. Otherwise, the read commandhandling procedure is concluded in step 310. Other exceptions may occurin step 304, and the embodiment does not limit other functionalities tobe implemented in the read command handling procedure. When a responseto the read command #R is output, the read command handling procedure isconcluded in step 310.

FIG. 4 is a flowchart of a write command handling procedure in the writeloop. The write command handling procedure is initialized in step 402.In step 404, the drive control unit 110 receives a write command #W anda write data block #D_(W) from the host 120, requesting to record thewrite data block #D_(W) into the optical disc 205. The drive controlunit 110 stores the received write data block #D_(W) into the writebuffer 210. In step 406, the read buffer 220 is checked to find outwhether other data blocks stored in the read buffer 220 associated withthe received write data block #D_(W) are correspondent to the same ECCblock. In step 408, it is determined whether the found data block isdetermined whether or not theyis contributive to the integrity of theECC block. If so, step 410 is processed, whereby the drive control unit110 copies the found data blocks from the read buffer 220 to the writebuffer 210 to increase the integrity of the ECC block. After step 410,the process may unconditionally jump to step 416 via a dot line 414,whereby the driverdrive control unit 110 copies the write data block#D_(W) from the write buffer 210 to the read buffer 220 upon receptionof the write data block #D_(W). Alternatively, the step 416 may beimplemented in conjunction with Step 412. In step 416, when the drivecontrol unit 110 receives the write data block #D_(W) from the host 120,the drive control unit 110 stores the received write data block #D_(W)into both of the write buffer 210 and the read buffer 220.

In other case, step 412 is executed after step 410, in which contents ofread buffer 220 are checked to determine whether the received write datablock #D_(W) is an update of the content stored in the read buffer 220.Else, the contents of read buffer 220 may also be checked to determinewhether the received write data block #D_(W) are associated to the sameECC block. A cache ‘hit’ may be detected for the received write datablock #D_(W), however, the latest received write data block #D_(W) wouldhave to overwrite any previous old copies in the write buffer 210 orread buffer 220. Thus, through step 412, step 416 will be executed whenan old copy of the write data block #D_(W) is previously presented inthe read buffer 220, or when the received write data block #D_(W) hasassociation with the contents stored in the read buffer 220. In step416, the write data block #D_(W) is copied to the read buffer 220.Lastly, the write command handling procedure is concluded in step 418.In other words, the embodiment demonstrates that the write data block#D_(W) can be directly (via dot line 414) or indirectly (via step 412)transferred to the read buffer 220.

FIG. 5 is a flowchart of a pre-recording procedure in the write loop. Asknown for data preparation procedure, an ECC block including a pluralityof data blocks is a basic unit for physical recording. When physicalrecording is required, the optical disc recorder 200 may perform aread-modify-write operation to assemble a complete ECC block in thewrite buffer 210. In a typical read-modify-write operation, if essentialdata blocks corresponding to the ECC block are unavailable in the writebuffer 210, they are automatically retrieved from the optical disc 205and stored in the write buffer 210. Therefore a read-modify-writeoperation is typically an aggressive data collection process. Thepre-recording procedure tends to prepare a more complete ECC blockpassively, thus essential data blocks corresponding to the ECC block aregathered as much as possible while in the write loop. Step 502initializes the pre-recording procedure. In step 504, the read buffer220 is checked to find out whether other data blocks associated with thesame ECC block exist. In step 506, the found data blocks are determinedwhether or not they contribute to the integrity of the ECC block. Ifthey do (Yes, step 508), the drive control unit 110 copies the founddata blocks from the read buffer 220 to the write buffer 210 to increasethe integrity of the ECC block. Otherwise, the pre-recording procedureis concluded in step 510.

In another exemplary embodiment, during the read-modify-write operation,data blocks corresponding to the ECC block may be retrieved from theoptical disc 205 and stored in the write buffer 210. The retrieved datablocks may be copied to the read buffer 220 for improving the readoperation efficiency.

The embodiments are particularly adaptable for a DVD-RAM or Blu-Rayrecorder. The write buffer 210 and read buffer 220 may be implemented inone memory array, or two individual memory devices. The embodiments of abuffer management method in the disclosure significantly improves theefficiency and performance for disc recording devices, especially forread-modify-write operations and random recording operation wherewriting and reading may simultaneously performed in a write loop.

While the invention has been described by way of example and in terms ofpreferred embodiment, it is to be understood that the invention is notlimited thereto. To the contrary, it is intended to cover variousmodifications and similar arrangements (as would be apparent to thoseskilled in the Art). Therefore, the scope of the appended claims shouldbe accorded the broadest interpretation so as to encompass all suchmodifications and similar arrangements.

What is claimed is:
 1. A buffer management method for a storage device,wherein the storage device comprises a read buffer, a write buffer and astorage medium, the method comprising: receiving a write command and awrite data block from a host for storing the write data block to thestorage medium; storing the write data block into a write buffer and aread buffer; receiving a read command from the host; and outputting thewrite data block from the read buffer to the host as a response to theread command, wherein the write data block associate with the readcommand.
 2. The buffer management method as claimed in claim 1, furthercomprising: accessing a read data block from the storage mediumaccording to the read command; determining whether the read data blockaccessed from the storage medium contributes to the integrity of an ECCblock in the write buffer; and copying the read data block to the writebuffer.
 3. A buffer management method for a storage device, wherein thestorage device comprises a read buffer, a write buffer and a storagemedium, the method comprising: receiving a write command and a writedata block from a host for storing the write data block to the storagemedium; storing the write data block into a write buffer determiningwhether the received write data block is an update version of anoriginal data block stored in the read buffer; and copying the writedata block from the write buffer to the read buffer if the determinationresult is positive
 4. The buffer management method as claimed in claim3, further comprising: receiving a read command from the host; accessinga read data block from the storage medium according to the read command;determining whether the read data block accessed from the storage mediumcontributes to the integrity of an ECC block in the write buffer; andcopying the read data block to the write buffer.